package net.zabuchy.issue.entity;

import java.io.Serializable;
import javax.persistence.*;


/**
 * The persistent class for the attachments database table.
 * 
 */
@Entity
@Table(name="attachments", catalog="quickstart")
public class Attachment implements Serializable {
	private static final long serialVersionUID = 1L;
	private int attachmentId;
	private String file;
	private String contentType;
	private String fileName;
	private Issue issue;

    public Attachment() {
    }


	public Attachment(String file, String contentType, String fileName,
			Issue issue) {
		super();
		this.file = file;
		this.contentType = contentType;
		this.fileName = fileName;
		this.issue = issue;
	}


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="ATTACHMENT_ID")
	public int getAttachmentId() {
		return this.attachmentId;
	}

	public void setAttachmentId(int attachmentId) {
		this.attachmentId = attachmentId;
	}

	@Column(name="FILE")
	public String getFile() {
		return this.file;
	}

	public void setFile(String file) {
		this.file = file;
	}
	
	@Column(name="CONTENT_TYPE")
	public String getContentType() {
		return contentType;
	}


	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	@Column(name="FILE_NAME")
	public String getFileName() {
		return fileName;
	}


	public void setFileName(String fileName) {
		this.fileName = fileName;
	}


	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "ISSUE_ID", nullable = false)
	public Issue getIssue() {
		return this.issue;
	}

	public void setIssue(Issue issue) {
		this.issue = issue;
	}
	
}